<%-- 
    Document   : dodaj_korisnika
    Created on : Dec 11, 2009, 10:11:10 PM
    Author     : Milan Boricic <boricic@gmail.com>
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Kreiranje novog korisnika</title>
    </head>
    <body>
    <h:form>
                <h:messages/>
                <h:panelGrid columns="2">
                    <f:facet name="header">
                        <h:outputText value="Kreirajte novog korisnika:"/>
                    </f:facet>

                    <h:outputLabel for = "username"
                                   value = "Korisničko ime" />
                    <h:inputText id="username"
                                 value="#{zahtevRegistracije.username}"
                                 required = "true"
                                 requiredMessage="Niste uneli željeno korisničko ime"/>

                    <h:outputLabel for = "password"
                                   value = "Lozinka" />
                    <h:inputSecret id="password"
                                 value="#{zahtevRegistracije.lozinka}"
                                 redisplay="false"
                                 required = "true"
                                 requiredMessage="Niste uneli lozinku"/>

                    <h:outputLabel for = "password2"
                                   value = "Ponovite lozinku" />
                    <h:inputSecret id="password2"
                                 value="#{zahtevRegistracije.lozinka2}"
                                 redisplay="false"
                                 required = "true"
                                 requiredMessage="Niste uneli ponovljenu lozinku"/>

                    <h:outputLabel for = "name"
                                   value = "Ime" />
                    <h:inputText id="name"
                                 value="#{zahtevRegistracije.ime}"
                                 required = "true"
                                 requiredMessage="Niste uneli ime"/>

                    <h:outputLabel for = "surname"
                                   value = "Prezime" />
                    <h:inputText id="surname"
                                 value="#{zahtevRegistracije.prezime}"
                                 required = "true"
                                 requiredMessage="Niste uneli prezime"/>

                    <h:outputLabel for = "email"
                                   value = "E-mail" />
                    <h:inputText id="email"
                                 value="#{zahtevRegistracije.email}"
                                 required = "true"
                                 requiredMessage="Niste uneli e-mail"/>

                    <h:outputLabel for = "funkcija"
                                   value = "Funkcija" />
                    <h:inputText id="funkcija"
                                 value="#{zahtevRegistracije.funkcija}"
                                 required = "true"
                                 requiredMessage="Niste uneli funkciju"/>

                    <h:outputLabel for = "admin"
                                   value = "Korisnik je administrator" />
                    <h:selectBooleanCheckbox id="admin"
                                 value="#{zahtevRegistracije.admin}"
                                 required = "true"
                                 requiredMessage="Niste uneli da li je korisnik administrator"/>

                    <f:facet name="footer">
                        <h:panelGroup style="display:block; text-align:center">
                            <h:commandButton value="Kreiraj" action="#{zahtevRegistracije.kreirajNovogKorisnika}" />
                        </h:panelGroup>
                    </f:facet>
                </h:panelGrid>
            </h:form>
    </body>
</html>
